package ma.cdm.compteRendu.bo;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * Detailpoint entity. @author Limouri Anouar
 */
@Entity
@Table(name="detailpoint")

public class DetailPoint  implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Long id;
	private SuiviPoint suivipoint;
	private String action;
	private String decision;
	private String suivi;
	private String daterealisation;
	private String dateformat;
	private String status;
	private Set<Responsablepoint> responsablepoints = new HashSet<Responsablepoint>(
			0);

	// Constructors

	/** default constructor */
	public DetailPoint() {
	}

	/** minimal constructor */
	public DetailPoint(SuiviPoint suivipoint) {
		this.suivipoint = suivipoint;
	}

	/** full constructor */
	public DetailPoint(SuiviPoint suivipoint, String action, String decision,
			String suivi, String daterealisation, String dateformat,
			String status, Set<Responsablepoint> responsablepoints) {
		this.suivipoint = suivipoint;
		this.action = action;
		this.decision = decision;
		this.suivi = suivi;
		this.daterealisation = daterealisation;
		this.dateformat = dateformat;
		this.status = status;
		this.responsablepoints = responsablepoints;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "IDSUIVI", nullable = false)
	public SuiviPoint getSuivipoint() {
		return this.suivipoint;
	}

	public void setSuivipoint(SuiviPoint suivipoint) {
		this.suivipoint = suivipoint;
	}

	@Column(name = "ACTION", length = 2000)
	public String getAction() {
		return this.action;
	}

	public void setAction(String action) {
		this.action = action;
	}

	@Column(name = "DECISION", length = 2000)
	public String getDecision() {
		return this.decision;
	}

	public void setDecision(String decision) {
		this.decision = decision;
	}

	@Column(name = "SUIVI", length = 2000)
	public String getSuivi() {
		return this.suivi;
	}

	public void setSuivi(String suivi) {
		this.suivi = suivi;
	}

	@Column(name = "DATEREALISATION")
	public String getDaterealisation() {
		return this.daterealisation;
	}

	public void setDaterealisation(String daterealisation) {
		this.daterealisation = daterealisation;
	}

	@Column(name = "DATEFORMAT")
	public String getDateformat() {
		return this.dateformat;
	}

	public void setDateformat(String dateformat) {
		this.dateformat = dateformat;
	}

	@Column(name = "STATUS")
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "detailpoint")
	public Set<Responsablepoint> getResponsablepoints() {
		return this.responsablepoints;
	}

	public void setResponsablepoints(Set<Responsablepoint> responsablepoints) {
		this.responsablepoints = responsablepoints;
	}

}